package com.nbsaas.boot.controller.shop;

import com.nbsaas.boot.rest.annotations.*;
import com.nbsaas.boot.rest.response.ListResponse;
import com.nbsaas.boot.rest.response.PageResponse;
import com.nbsaas.boot.rest.response.ResponseObject;
import com.nbsaas.boot.shop.api.domain.request.ShopOauthTokenRequest;
import com.nbsaas.boot.shop.api.domain.request.ShopOauthTokenSearch;
import com.nbsaas.boot.shop.api.domain.response.ShopOauthTokenResponse;
import com.nbsaas.boot.shop.api.domain.simple.ShopOauthTokenSimple;
import com.nbsaas.boot.shop.api.apis.ShopOauthTokenApi;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;

/**
*  控制器
*/
@RequiresAuthentication
@RestController
@RequestMapping("/shopOauthToken")
public class ShopOauthTokenController {


    @Resource
    private ShopOauthTokenApi shopOauthTokenApi;

    /**
    * 查看数据
    *
    * @param request
    * @return
    */
    @SearchData
    @RequiresPermissions("shopOauthToken")
    @PostMapping("/view")
    public ResponseObject <ShopOauthTokenResponse> view(@RequestBody @Validated(ViewOperator.class) ShopOauthTokenRequest  request) {
        return shopOauthTokenApi.view(request);
    }
}